from common.logger import logger


class CommonHeaders:
    def __init__(self):
        self.token = None

    def set_token(self, token):
        self.token = token

    def get_headers(self):
        if self.token:
            logger.info(f"Token: {self.token}")
            return {
                # "Authorization": f"Bearer {self.token}",
                "Authorization": "OTU0dXF0MG5zamVoZ2l4dGEzN2luMDg1Ond6MW51enB4amQ1bG5xN3JhM2V3aHFzcHhuMnBnZHQy",
                "Applicationid": "464781535210464262",
                "Butenantid": "439938383512058064",
                "Accept": "application/json, text/plain, */*",
                "Versiontype": "2",
                "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
                "Content-Type": "application/json",
                "Host": "test-school-dl.workeredu.com",
                "Accept-Encoding": "gzip, deflate, br",
                "Connection": "keep-alive",
                "token": f"Bearer {self.token}"
            }
        else:
            return {
                "Authorization": "OTU0dXF0MG5zamVoZ2l4dGEzN2luMDg1Ond6MW51enB4amQ1bG5xN3JhM2V3aHFzcHhuMnBnZHQy",
                "Applicationid": "464781535210464262",
                "Butenantid": "439938383512058064",
                "Accept": "application/json, text/plain, */*",
                "Versiontype": "2",
                "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
                "Content-Type": "application/json",
                "Host": "test-school-dl.workeredu.com",
                "Accept-Encoding": "gzip, deflate, br",
                "Connection": "keep-alive"
            }